<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "白泽艺考">
</@frame.head>
<div class="page-container">
	<form action="${contextPath}/organization/organization_update" method="post" class="form form-horizontal" id="form-resource">
	<input type="hidden"  name="parentId" id="parentId" value="${organization.id?c}"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				<span class="c-red">*</span>
				机构名称：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input type="text" class="input-text" value="${organization.name}" placeholder="" id="name" name="name">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				机构地址：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<select name="province" id="province" onchange="show(this.options[this.options.selectedIndex].value)">
				<option value="" >请选择</option>
				<#list cnnojd as list>
					<option value="${list.id}">${list.name}</option>
				</#list>						
				</select>
				<select name="city" id="city" onchange="show2(this.options[this.options.selectedIndex].value)">
				</select> 
				<select name="county" id="county">
				</select> 
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				机构电话：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input type="text" class="input-text" value="${organization.phone}" placeholder="" id="phone" name="phone">
			</div>
		</div>
		 <div class="container row cl">
                        <div class="col-xs-2 col-sm-2 text-r">
                            <h3><small>是否开启机构宣传：</small></h3>
                        </div>
                        <div class="col-xs-5 col-sm-5">
                            <div class="radio-box">
                                <input type="radio"  id="free" name="isopenAgencyPromotion" value="1" <#if organization.isopenAgencyPromotion==1>	checked</#if>>
                                <label for="free">是</label>
                            </div>
                            <div class="radio-box">
                                <input type="radio"  id="notfreee" name="isopenAgencyPromotion" value="2" <#if organization.isopenAgencyPromotion==2>	checked</#if>>
                                <label for="notfreee">否</label>
                            </div>
                        </div>
                    </div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				机构评语：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input type="text" class="input-text" value="${organization.comment}" placeholder="" id="comment" name="comment">
			</div>
		</div>
		 <div class="container row cl">
                        <div class="col-xs-2 col-sm-2 text-r">
                            <h3><small><span style="color:red;">*</span>详情描述：</small></h3>
                        </div>
	                       <div class="formControls col-xs-6 col-sm-6">
				
				<textarea cols="80" id="content" name="details" >${organization.details}</textarea> 
             			<script type="text/javascript">
	            			 window.onload = function(){ 
	            				 CKEDITOR.replace('content',{filebrowserUploadUrl : path+'/ckeditor/uploader?Type=File&prodId=1111&uploadModel=product',filebrowserImageUploadUrl : path+'/ckeditor/uploader?Type=Image&prodId=${1111}&uploadModel=product',filebrowserFlashUploadUrl : path+'/ckeditor/uploader?Type=Flash&prodId=${1111}&uploadModel=product'});
          				 	  }
           				 </script>
					</div>
                    </div>
		<div class="row cl">
			<div class="col-9 col-offset-2">
				<input class="btn btn-primary radius" type="button" onclick="modify();"  value="&nbsp;&nbsp;修改&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>
<@frame.end "default">
</@frame.end>
<script type="text/javascript" src="${contextPath}/resources/lib/zTree/v3/js/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript" src="${contextPath}/resources/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script> 
<script type="text/javascript" src="${contextPath}/resources/js/system/organization.js"></script>
 <script type="text/javascript" src="${contextPath}/resources/js/tool/ckeditor/ckeditor.js"></script>
    <link rel="stylesheet" href="${contextPath}/resources/static/h-ui/css/H-ui.css">
<script type="text/javascript">
var path="${contextPath}";

function show(type) {
	if (type=="") {
		var sts;
		sts="<option value>请选择</option>";
		$("#city").html(sts);
		$("#county").html(sts);
	}else{ 
		$.ajax({
			url : path+"/organization/Three_level_linkage?pid="+type,
			cache : false,
			type : 'post',
			dataType : 'json',
			success : function(data) {
				console.log(data)
				var arr=data.message;
				var str;
				if(data.code=="200"){
					for(var i=0;i<arr.length;i++){
						str=str+"<option value="+arr[i].id+" >"+arr[i].name+"</option>";
					}
					 $("#city").html(str);
				}else if(data.code=="500"){
					layer.alert("系统繁忙！");
				}
			}
		})
		var sts;
		sts="<option value></option>";
		$("#county").html(sts);
	}
}
function show2(pid){
	if (pid=="") {
		var sts;
		sts="<option value>请选择</option>";
		$("#county").html(sts);
	}else{ 
	$.ajax({
		url : path+"/organization/Three_level_linkage?pid="+pid,
		cache : false,
		type : 'post',
		dataType : 'json',
		success : function(data) {
			console.log(data)
			var arr=data.message;
			var str;
			if(data.code=="200"){
				for(var i=0;i<arr.length;i++){
					str=str+"<option value="+arr[i].id+" >"+arr[i].name+"</option>";
				}
				 $("#county").html(str);
			}else if(data.code=="500"){
				layer.alert("系统繁忙！");
			}
		}
	})
}
	
}

</script>
</body>
</html>